//------------------------------------------------------------------------------
//  shapenode.cc
//  (C) 2007 Radon Labs GmbH
//------------------------------------------------------------------------------
#include "stdneb.h"
#include "shapenode.h"


namespace Models
{
__ImplementClass(Models::ShapeNode, 'SPND', Models::StateNode);

using namespace Util;
using namespace IO;

//------------------------------------------------------------------------------
/**
*/
ShapeNode::ShapeNode() :
    primGroupIndex(InvalidIndex)
{
    // empty
}

//------------------------------------------------------------------------------
/**
*/
ShapeNode::~ShapeNode()
{    
}

//------------------------------------------------------------------------------
/**
*/
bool
ShapeNode::WriteDataTag(Ptr<ToolkitUtil::ModelWriter>& writer)
{
	if(StateNode::WriteDataTag(writer))
	{
		writer->BeginTag("Mesh", FourCC('MESH'));
		writer->WriteString(meshResId);
		writer->EndTag();

		writer->BeginTag("PrimitiveGroupIndex", FourCC('PGRI'));
		writer->WriteInt(primGroupIndex);
		writer->EndTag();
		return true;	
	}	

	return false;
}

} // namespace Models